import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;

public class Client_01{
	public static void main(String[] args) throws IOException {
		Socket socket = new Socket("127.0.0.1",8889);
    	
    	BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
    	BufferedReader br2 = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    	
    	BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
    	
    	while(true){
    		String line = br1.readLine();
    		bw.write(line);
    		bw.newLine();
    		bw.flush();
    		if(line.equals("over")){
    			break;
    		}
    		System.out.println(br2.readLine());
    	}
    	
    	br1.close();
    	br2.close();
    	bw.close();
    	socket.close();
	}
}
